<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Filling the Form </title>
<link href="/css/template.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
</head>
<?php
date_default_timezone_set('Australia/Melbourne');
$dateToday = date("Y-m-d");	

//check if the item exist in the DB 
$error_flag = 0;
$products = new Model_DbTable_Productsva();
$productName = $products->getProductNameByCode(trim($this->productcode));
if(!$productName){
		$error_flag = 1;	
	}
?>
<body>
<script>
	$(function() {
		$( "#salesdate" ).datepicker({ dateFormat: "yy-mm-dd" });
		$( "#returndate" ).datepicker({ dateFormat: "yy-mm-dd" });
	});
	</script>
<form id="form1" name="form1" method="post" action="/rma/confirm">
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="center">

  <tr>
    <td style="text-align:center; background-color:#FF9;">**PRINT NOT NECESSARY**</td>
  </tr>
  <tr>
    <td>This new RAM lodged For [<?php echo $this->shophead; ?>] by "<?php echo $this->staffname; ?>" on <?php echo $dateToday;?>
      <input name="shop_head" type="hidden" value="<?php echo $this->shophead; ?>" />
    <input name="staff_name" type="hidden" value="<?php echo $this->staffname; ?>" />
    <input name="faulty_reason" type ="hidden" value = "99999"></input>
    </td>
  </tr>
  <tr>
    <td><br />
      Product Code(bar code) for this Lodgement is<br />
    <br /></td>
  </tr>
  <tr>
    <td style="text-align:center"><h1><?php echo $this->productcode; ?></h1>
    <?php
    if($error_flag){
		echo "<br /><span style=\"color:#F00; font-weight:bold;\"> the product Code not found in the DB , it will pass , however it is recommended that you GO BACK find the correct code</span> ";
		}
	?>
    <input name="product_code" type="hidden" value="<?php echo $this->productcode; ?>" /></td>
  </tr>
  <tr>
    <td>Please Type the Product Name Here<span style="color:#f00;">*</span>:<br />
      <br />
<?php
if(!$productName){
	$productName = "Input Product Name";
	}
?>    
      <input type="text" name="product_name" id="textfield" style="width:1000px" value="<?php echo $productName;?>"  /><br />

</td>
  </tr>
  <tr>
    <td>Choose the Faulty Reason, select between &quot;New Faulty&quot;and &quot;Returned Product&quot;<span style="color:#f00;"> *</span><br />
      <br /></td>
  </tr>
  <tr>
    <td>
      <br />
      Your comment (<strong>and Fill <span style="color:#ff0000">Sales Invoice Number</span> for &quot;Returned Product&quot;</strong>):</td>
  </tr>
  <tr>
    <td>
      <textarea style="width:1000px" name="faulty_comment" id="textarea" cols="100" rows="3"></textarea></td>
  </tr>
  <tr>
    <td>*If you have doubts about our warranty policy ,please call head office</td>
  </tr>
  <tr>
    <td>*you are fully understand our policy and consider this case has fullfill one of our <br />
      <br /></td>
  </tr>
  <tr>
    <td style="text-align:center;"><input type="submit" name="button" id="button" value="CREATE THE SUMMAY" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
 
</table>
  </form> 

</body>
</html>